<template>
  <div>
    <el-dialog
      title="策略管理"
      :visible="policyVisible"
      width="35%"
      @close="cancel"
      @opened = 'open'
    >
      <span class="box">
        <div>
          <p class="title">机器编号：<span>ooooo</span></p>
          <p class="title">策略名称：<span>九折优惠</span></p>
        </div>
        <p class="title">策略方案：<span>90%</span></p>
      </span>
      <span slot="footer" class="dialog-footer" style="text-align = center; margin-right: 200px">
        <el-button @click="cancel">取消策略</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { getVmPolicy } from '@/api/Equipment'
export default {
  props: {
    policyVisible: {
      type: Boolean,
      required: true
    },
    policySope: {
      type: Object,
      required: true
    }
  },
  data () {
    return {}
  },
  methods: {
    async open () {
      await getVmPolicy(this.policySope.innerCode)
    },
    cancel () {
      this.$emit('update:policyVisible', false)
    }
  }
}
</script>

<style scoped lang="scss">
.el-dialog {
  .el-dialog__title {
    font-size: 16px;
  }
}
.box {
  width: 500px;
  height: 200px;
  div {
    display: flex;
    width: 100%;
  }
  .title {
    display: block;
    float: left;
    flex: 12;
    width: 200px;
  }
}
</style>
